//短信应用场景
// 自动轮播切换
const WAIT=3000;
var moved=0,newMoved=null;
var timer=null;
function move(){
	moved+=1;
	//右侧初始化
	$('.BG-two>.cont>.flex>.two-ul ul li').css('border-right-color','#e7e7e7');
	$('.BG-two>.cont>.flex>.two-ul ul li>.img').css('opacity','0');
	$('.BG-two>.cont>.flex>.two-ul ul li>a>span').css('color','#666');

	//左侧初始化
	$('.BG-two>.cont>.flex>.two-cont>div').hide();
	var prey='.BG-two>.cont>.flex>.two-cont>.change'+moved;
	//console.log('自动',prey);
	var left='.two-ul ul li:nth-child('+moved+')';

	//左侧变化
	$(left).css('border-right-color','#00a4ff').children().children().css('color','#00a4ff');
	$(left).children('.img').css('opacity','1');
	//右侧变化
	$(prey).show().removeClass('fadeInUp').removeClass('animated');
	if(moved==8){moved=0}
	//console.log(moved);
}
var timer=setInterval(move,WAIT);
//进入后禁止轮播
$(".BG-two>.cont>.flex").hover(
function(){
	newMoved=moved; clearInterval(timer); timer=null;
	moved=newMoved;
},
function(){timer=setInterval(move,WAIT);}
);
//手动轮播切换
$('.BG-two>.cont>.flex>.two-cont>div:not(:first-child)').hide();
$('.BG-two>.cont>.flex>.two-ul ul li ').hover(
function(){
	$('.BG-two>.cont>.flex>.two-ul ul li').css('border-right-color','#e7e7e7');
	$('.BG-two>.cont>.flex>.two-ul ul li>.img').css('opacity','0');
	$('.BG-two>.cont>.flex>.two-ul ul li>a>span').css('color','#666');
	$('.BG-two>.cont>.flex>.two-cont>div').hide();
	var $this = $(this);
	var mid = $this.attr('myid');
	var prey='.BG-two>.cont>.flex>.two-cont>.change'+mid;moved=parseFloat(mid);
	//console.log('手动',prey);
	$(prey).show().removeClass('fadeInUp').removeClass('animated');
	$this.children().children().css('color','#00a4ff');//更改字体颜色
	$this.css('border-right-color','#00a4ff');
	$this.children('.img').css('opacity','1');
},
function(){
}
)
//短信套餐包点击展开
$('.look>.look-title').click(function(){
$('.meal-hide').css('display','flex');
})
//短信套餐包悬停特效
$('.BG-meal>.cont>.flex>div').hover(
function () {
	var $this = $(this);
	$this.children("div:first-child").css('background-color', '#1EB9FC');
	$this.children("div:first-child").children('span').css('color','#fff');
	$this.children("div:last-child").show();
},
function () {
	var $this = $(this);
	$this.children("div:first-child").css('background-color', '#F6F7F9');
	$this.children("div:last-child").hide();
	$this.children("div:first-child").children('span').css('color','#34323b');
}
)
//帮助文档悬停特效
$('.document .cont>.flex>.flex').hover(
	function () {
		var $this = $(this);
		var mid = $this.attr('myd');
		$this.css('border-color', '#FFB44D');
		$this.children('div:first-child').css(
			{
				'background': 'url(images/product/' + mid + '.png) no-repeat',
				'border-right-color': '#F8C88A'
			}
		);
		$this.children('div:last-child').children('p:first-child').css('color', '#ff9606')
	},
	function () {
		var $this = $(this);
		var oid = $this.attr('oid');
		$this.css('border-color', '#D5D5D5');
		$this.children('div:first-child').css(
			{
				'background': 'url(images/product/' + oid + '.png) no-repeat',
				'border-right-color': '#DFDFDF'
			}
		);
		$this.children('div:last-child').children('p:first-child').css('color', '#333')
	}
)
//帮助文档页面跳转
$('.document .cont>.flex>div').click(function(){
	var $this=$(this);
	var aid=$this.attr('aid');
	//console.log('aid',aid);
	localStorage.setItem('stateChild',aid);
	window.location.href='document.html';
})
$('#State1').click(function(){
	localStorage.setItem('state',1);
	localStorage.setItem('stateChild',null);
})
$('#State2').click(function(){
	localStorage.setItem('stateChild',null);
})